﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;

namespace Xugege.AbpExtension.Core.Extension.File
{

    [Table("UploadFileRecord")]
    public class UploadFileRecord : Entity<long>
    {
        public UploadFileRecord()
        {
            UploadTime = DateTime.Now;
        }

        /// <summary>
        /// 文件实例Id (文件存储名称)
        /// </summary>
        [Required]
        public Guid InstanceId { get; set; }
        /// <summary>
        /// 原始文件名（包含后缀）
        /// </summary>
        [Required]
        public string FileName { get; set; }
        /// <summary>
        /// 相对路径（包含名称）
        /// </summary>
        [Required]
        public string RealPath { get; set; }

        /// <summary>
        /// 文件大小
        /// </summary>
        [Required]
        public long FileSize { get; set; }

        /// <summary>
        /// 上传时间
        /// </summary>
        [Required]
        public DateTime UploadTime { get; set; }
        /// <summary>
        /// 上传者
        /// </summary>
        [Required]
        public long Uploader { get; set; }

        [Required]
        public string FileType { get; set; }

        [NotMapped]
        public byte[] Bytes { get; set; }
    }
}
